home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWString / SLTxtRun.xh < prev    next >
Encoding:
Text File  |  1996-09-16  |  18.5 KB  |  772 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLTxtRun.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * 
  13.  *     File:        SLTxtRun.idl
  14.  * 
  15.  *     Contains:    Interface for OTextRunReader and OTextRunWriter classes
  16.  * 
  17.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  18.  * 
  19.  * 
  20.  */
  21.  
  22.  
  23. #ifndef SOM_FW_OTextRunReader_xh
  24. #define SOM_FW_OTextRunReader_xh
  25.  
  26. class FW_OTextRunReader;
  27.  
  28. #define FW_OTextRunReader_MajorVersion 1
  29. #define FW_OTextRunReader_MinorVersion 0
  30.  
  31. /*
  32.  * Passthru lines: File: "C.xh", "before"
  33.  */
  34.  
  35.  
  36. /* C++ SOM defs */
  37. #include <somcls.xh>
  38. #include <somcm.xh>
  39.  
  40. /* C++ parent defs */
  41. #ifndef SOM_SOMObject_xh
  42. #include <somobj.xh>
  43. #endif
  44.  
  45. #ifndef FW_OTextRunReader_API
  46. #define FW_OTextRunReader_API
  47. /*
  48.  * -- The Class API
  49.  */
  50.  
  51. /*
  52.  * Start of user-defined types:
  53.  */
  54. class SOMClass;
  55. class SOMObject;
  56. class FW_OTextRunReader;
  57. class FW_OTextRunWriter;
  58. class FW_OMemoryRunReader;
  59. class FW_OMemoryRunWriter;
  60.  
  61. /*
  62.  * End of user-defined types.
  63.  */
  64.  
  65. #ifdef OLDIBMSOMAPISUPPORT
  66. #define FW_OTextRunReaderCClassData FW_OTextRunReaderClassData
  67. #define FW_OTextRunReaderNewClass(major,minor) somNewVersionedClassReference(FW_OTextRunReader,major,minor)
  68. #endif
  69.  
  70. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  71. #define FW_OTextRunReaderMetaClass SOMClass
  72.  
  73. #if PRAGMA_ALIGN_SUPPORTED
  74. #  pragma options align=power
  75. #endif
  76.  
  77. /* The API to the FW_OTextRunReader class object, and the methods it introduces. */
  78. SOMEXTERN struct FW_OTextRunReaderClassDataStructure {
  79. #ifdef OLDIBMSOMAPISUPPORT
  80.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  81. #else
  82.     long zero;
  83. #endif
  84.     somStaticClassInfo *sci;
  85.     somDToken        instanceDataToken;
  86.     long reserved [3];
  87.     somMToken GetCurrentRun;
  88.     somMToken NextRun;
  89.     somMToken PreviousRun;
  90.     somMToken GetTotalLength;
  91. } SOMDLINK FW_OTextRunReaderClassData;
  92.  
  93. #if PRAGMA_ALIGN_SUPPORTED
  94. #  pragma options align=reset
  95. #endif
  96.  
  97. #if !defined(FW_OTextRunReader_Class_Source) && !defined(SOM_Module_sltxtrun_Source)
  98. #if PRAGMA_IMPORT_SUPPORTED
  99. #pragma import list FW_OTextRunReaderClassData
  100. #endif
  101. #endif
  102.  
  103.  
  104. /*
  105.  * -- Typedefs and inline method declarations for left path inherited methods
  106.  * -- are omitted because this compilation had -museinheritedmethods in effect
  107.  */
  108.  
  109.  
  110. /*
  111.  * -- Typedefs for FW_OTextRunReader Method Procedures
  112.  */
  113. SOMEXTERN {
  114. typedef corbastring   (* SOMLINK somTD_FW_OTextRunReader_GetCurrentRun)(FW_OTextRunReader *somSelf, Environment *ev,
  115.         FW_ByteCount* length,
  116.         FW_Locale* locale);
  117. typedef boolean   (* SOMLINK somTD_FW_OTextRunReader_NextRun)(FW_OTextRunReader *somSelf, Environment *ev);
  118. typedef boolean   (* SOMLINK somTD_FW_OTextRunReader_PreviousRun)(FW_OTextRunReader *somSelf, Environment *ev);
  119. typedef FW_ByteCount   (* SOMLINK somTD_FW_OTextRunReader_GetTotalLength)(FW_OTextRunReader *somSelf, Environment *ev);
  120. }
  121.  
  122. #endif /* FW_OTextRunReader_API */
  123.  
  124.  
  125. /*
  126.  * -- This emitter treats Method Tokens as Thunks by default.
  127.  * -- Use the sc modifier "nothunks" to change this default
  128.  */
  129. #undef somresolve_
  130. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  131.  
  132. /*
  133.  * -- The C++ Wrapper Class for FW_OTextRunReader
  134.  */
  135. class FW_OTextRunReader : public SOMObject
  136. {
  137. public:
  138.  
  139. // FW_OTextRunReader::new registers use of the class object, and then uses somNew
  140. // to allocate memory and load the object method table pointer. 
  141. void *operator new(size_t size)
  142. {
  143.     SOM_IgnoreWarning(size);
  144.     // Allocate memory using the default allocator for FW_OTextRunReader, and
  145.     // clear mem & set method table pointer, call basic initialization
  146. #ifdef SOMCHKNULL
  147.     void * __somResult = (void *)
  148.       somNewObject(FW_OTextRunReader);
  149.     SOMCHKNULL(__somResult);
  150.     return __somResult;
  151. #else
  152.     return (void*) somNewObject(FW_OTextRunReader);
  153. #endif
  154. }
  155.  
  156. // FW_OTextRunReader::delete uses the default deallocator for the object's class.
  157. void operator delete(void * obj)
  158. {
  159.     if (obj) {
  160.         SOM_Resolve(obj,SOMObject,somFree)
  161.            ( (SOMObject*) obj );
  162.     }
  163. }
  164.  
  165. /* method: GetCurrentRun */
  166. corbastring   GetCurrentRun(Environment *ev,
  167.         FW_ByteCount* length,
  168.         FW_Locale* locale)
  169. {
  170.    #ifdef SOMCHKEXCEPT
  171.    corbastring __somResult = 
  172.       SOM_ResolveD(this,FW_OTextRunReader,FW_OTextRunReader,GetCurrentRun)
  173.     (this,ev,length,locale);
  174.       SOMCHKEXCEPT;
  175.    return __somResult;
  176. #else
  177.    return SOM_ResolveD(this,FW_OTextRunReader,FW_OTextRunReader,GetCurrentRun)
  178.     (this,ev,length,locale);
  179. #endif
  180. }
  181.  
  182. /* method: NextRun */
  183. boolean   NextRun(Environment *ev)
  184. {
  185.    #ifdef SOMCHKEXCEPT
  186.    boolean __somResult = 
  187.       SOM_ResolveD(this,FW_OTextRunReader,FW_OTextRunReader,NextRun)
  188.     (this,ev);
  189.       SOMCHKEXCEPT;
  190.    return __somResult;
  191. #else
  192.    return SOM_ResolveD(this,FW_OTextRunReader,FW_OTextRunReader,NextRun)
  193.     (this,ev);
  194. #endif
  195. }
  196.  
  197. /* method: PreviousRun */
  198. boolean   PreviousRun(Environment *ev)
  199. {
  200.    #ifdef SOMCHKEXCEPT
  201.    boolean __somResult = 
  202.       SOM_ResolveD(this,FW_OTextRunReader,FW_OTextRunReader,PreviousRun)
  203.     (this,ev);
  204.       SOMCHKEXCEPT;
  205.    return __somResult;
  206. #else
  207.    return SOM_ResolveD(this,FW_OTextRunReader,FW_OTextRunReader,PreviousRun)
  208.     (this,ev);
  209. #endif
  210. }
  211.  
  212. /* method: GetTotalLength */
  213. FW_ByteCount   GetTotalLength(Environment *ev)
  214. {
  215.    #ifdef SOMCHKEXCEPT
  216.    FW_ByteCount __somResult = 
  217.       SOM_ResolveD(this,FW_OTextRunReader,FW_OTextRunReader,GetTotalLength)
  218.     (this,ev);
  219.       SOMCHKEXCEPT;
  220.    return __somResult;
  221. #else
  222.    return SOM_ResolveD(this,FW_OTextRunReader,FW_OTextRunReader,GetTotalLength)
  223.     (this,ev);
  224. #endif
  225. }
  226.  
  227. };   /* FW_OTextRunReader */
  228.  
  229.  
  230.  
  231. #endif       /* SOM_FW_OTextRunReader_xh */
  232.  
  233. #ifndef SOM_FW_OTextRunWriter_xh
  234. #define SOM_FW_OTextRunWriter_xh
  235.  
  236. class FW_OTextRunWriter;
  237.  
  238. #define FW_OTextRunWriter_MajorVersion 1
  239. #define FW_OTextRunWriter_MinorVersion 1
  240.  
  241. /*
  242.  * Passthru lines: File: "C.xh", "before"
  243.  */
  244.  
  245.  
  246. /* C++ SOM defs */
  247. #include <somcls.xh>
  248. #include <somcm.xh>
  249.  
  250. /* C++ parent defs */
  251. #ifndef SOM_SOMObject_xh
  252. #include <somobj.xh>
  253. #endif
  254.  
  255. #ifndef FW_OTextRunWriter_API
  256. #define FW_OTextRunWriter_API
  257. /*
  258.  * -- The Class API
  259.  */
  260.  
  261. /*
  262.  * Start of user-defined types:
  263.  */
  264.  
  265. /*
  266.  * End of user-defined types.
  267.  */
  268.  
  269. #ifdef OLDIBMSOMAPISUPPORT
  270. #define FW_OTextRunWriterCClassData FW_OTextRunWriterClassData
  271. #define FW_OTextRunWriterNewClass(major,minor) somNewVersionedClassReference(FW_OTextRunWriter,major,minor)
  272. #endif
  273.  
  274. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  275. #define FW_OTextRunWriterMetaClass SOMClass
  276.  
  277. #if PRAGMA_ALIGN_SUPPORTED
  278. #  pragma options align=power
  279. #endif
  280.  
  281. /* The API to the FW_OTextRunWriter class object, and the methods it introduces. */
  282. SOMEXTERN struct FW_OTextRunWriterClassDataStructure {
  283. #ifdef OLDIBMSOMAPISUPPORT
  284.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  285. #else
  286.     long zero;
  287. #endif
  288.     somStaticClassInfo *sci;
  289.     somDToken        instanceDataToken;
  290.     long reserved [3];
  291.     somMToken GetCurrentRun;
  292.     somMToken FlushRun;
  293.     somMToken NewRun;
  294.     somMToken GetLocale;
  295. } SOMDLINK FW_OTextRunWriterClassData;
  296.  
  297. #if PRAGMA_ALIGN_SUPPORTED
  298. #  pragma options align=reset
  299. #endif
  300.  
  301. #if !defined(FW_OTextRunWriter_Class_Source) && !defined(SOM_Module_sltxtrun_Source)
  302. #if PRAGMA_IMPORT_SUPPORTED
  303. #pragma import list FW_OTextRunWriterClassData
  304. #endif
  305. #endif
  306.  
  307.  
  308. /*
  309.  * -- Typedefs and inline method declarations for left path inherited methods
  310.  * -- are omitted because this compilation had -museinheritedmethods in effect
  311.  */
  312.  
  313.  
  314. /*
  315.  * -- Typedefs for FW_OTextRunWriter Method Procedures
  316.  */
  317. SOMEXTERN {
  318. typedef corbastring   (* SOMLINK somTD_FW_OTextRunWriter_GetCurrentRun)(FW_OTextRunWriter *somSelf, Environment *ev,
  319.         FW_ByteCount* length);
  320. typedef void   (* SOMLINK somTD_FW_OTextRunWriter_FlushRun)(FW_OTextRunWriter *somSelf, Environment *ev,
  321.         corbastring buffer,
  322.         FW_ByteCount bytesToFlush);
  323. typedef boolean   (* SOMLINK somTD_FW_OTextRunWriter_NewRun)(FW_OTextRunWriter *somSelf, Environment *ev,
  324.         FW_Locale* locale);
  325. typedef void   (* SOMLINK somTD_FW_OTextRunWriter_GetLocale)(FW_OTextRunWriter *somSelf, Environment *ev,
  326.         FW_Locale* locale);
  327. }
  328.  
  329. #endif /* FW_OTextRunWriter_API */
  330.  
  331.  
  332. /*
  333.  * -- This emitter treats Method Tokens as Thunks by default.
  334.  * -- Use the sc modifier "nothunks" to change this default
  335.  */
  336. #undef somresolve_
  337. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  338.  
  339. /*
  340.  * -- The C++ Wrapper Class for FW_OTextRunWriter
  341.  */
  342. class FW_OTextRunWriter : public SOMObject
  343. {
  344. public:
  345.  
  346. // FW_OTextRunWriter::new registers use of the class object, and then uses somNew
  347. // to allocate memory and load the object method table pointer. 
  348. void *operator new(size_t size)
  349. {
  350.     SOM_IgnoreWarning(size);
  351.     // Allocate memory using the default allocator for FW_OTextRunWriter, and
  352.     // clear mem & set method table pointer, call basic initialization
  353. #ifdef SOMCHKNULL
  354.     void * __somResult = (void *)
  355.       somNewObject(FW_OTextRunWriter);
  356.     SOMCHKNULL(__somResult);
  357.     return __somResult;
  358. #else
  359.     return (void*) somNewObject(FW_OTextRunWriter);
  360. #endif
  361. }
  362.  
  363. // FW_OTextRunWriter::delete uses the default deallocator for the object's class.
  364. void operator delete(void * obj)
  365. {
  366.     if (obj) {
  367.         SOM_Resolve(obj,SOMObject,somFree)
  368.            ( (SOMObject*) obj );
  369.     }
  370. }
  371.  
  372. /* method: GetCurrentRun */
  373. corbastring   GetCurrentRun(Environment *ev,
  374.         FW_ByteCount* length)
  375. {
  376.    #ifdef SOMCHKEXCEPT
  377.    corbastring __somResult = 
  378.       SOM_ResolveD(this,FW_OTextRunWriter,FW_OTextRunWriter,GetCurrentRun)
  379.     (this,ev,length);
  380.       SOMCHKEXCEPT;
  381.    return __somResult;
  382. #else
  383.    return SOM_ResolveD(this,FW_OTextRunWriter,FW_OTextRunWriter,GetCurrentRun)
  384.     (this,ev,length);
  385. #endif
  386. }
  387.  
  388. /* method: FlushRun */
  389. void   FlushRun(Environment *ev,
  390.         corbastring buffer,
  391.         FW_ByteCount bytesToFlush)
  392. {
  393.    SOM_ResolveD(this,FW_OTextRunWriter,FW_OTextRunWriter,FlushRun)
  394.     (this,ev,buffer,bytesToFlush);
  395. #ifdef SOMCHKEXCEPT
  396.       SOMCHKEXCEPT;
  397. #endif
  398. }
  399.  
  400. /* method: NewRun */
  401. boolean   NewRun(Environment *ev,
  402.         FW_Locale* locale)
  403. {
  404.    #ifdef SOMCHKEXCEPT
  405.    boolean __somResult = 
  406.       SOM_ResolveD(this,FW_OTextRunWriter,FW_OTextRunWriter,NewRun)
  407.     (this,ev,locale);
  408.       SOMCHKEXCEPT;
  409.    return __somResult;
  410. #else
  411.    return SOM_ResolveD(this,FW_OTextRunWriter,FW_OTextRunWriter,NewRun)
  412.     (this,ev,locale);
  413. #endif
  414. }
  415.  
  416. /* method: GetLocale */
  417. void   GetLocale(Environment *ev,
  418.         FW_Locale* locale)
  419. {
  420.    SOM_ResolveD(this,FW_OTextRunWriter,FW_OTextRunWriter,GetLocale)
  421.     (this,ev,locale);
  422. #ifdef SOMCHKEXCEPT
  423.       SOMCHKEXCEPT;
  424. #endif
  425. }
  426.  
  427. };   /* FW_OTextRunWriter */
  428.  
  429.  
  430.  
  431. #endif       /* SOM_FW_OTextRunWriter_xh */
  432.  
  433. #ifndef SOM_FW_OMemoryRunReader_xh
  434. #define SOM_FW_OMemoryRunReader_xh
  435.  
  436. class FW_OMemoryRunReader;
  437.  
  438. #define FW_OMemoryRunReader_MajorVersion 1
  439. #define FW_OMemoryRunReader_MinorVersion 0
  440.  
  441. /*
  442.  * Passthru lines: File: "C.xh", "before"
  443.  */
  444.  
  445.  
  446. /* C++ SOM defs */
  447. #include <somcls.xh>
  448. #include <somcm.xh>
  449.  
  450. /* C++ parent defs */
  451. #ifndef SOM_FW_OTextRunReader_xh
  452. #include <SLTxtRun.xh>
  453. #endif
  454.  
  455. #ifndef FW_OMemoryRunReader_API
  456. #define FW_OMemoryRunReader_API
  457. /*
  458.  * -- The Class API
  459.  */
  460.  
  461. /*
  462.  * Start of user-defined types:
  463.  */
  464.  
  465. /*
  466.  * End of user-defined types.
  467.  */
  468.  
  469. #ifdef OLDIBMSOMAPISUPPORT
  470. #define FW_OMemoryRunReaderCClassData FW_OMemoryRunReaderClassData
  471. #define FW_OMemoryRunReaderNewClass(major,minor) somNewVersionedClassReference(FW_OMemoryRunReader,major,minor)
  472. #endif
  473.  
  474. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  475. #define FW_OMemoryRunReaderMetaClass SOMClass
  476.  
  477. #if PRAGMA_ALIGN_SUPPORTED
  478. #  pragma options align=power
  479. #endif
  480.  
  481. /* The API to the FW_OMemoryRunReader class object, and the methods it introduces. */
  482. SOMEXTERN struct FW_OMemoryRunReaderClassDataStructure {
  483. #ifdef OLDIBMSOMAPISUPPORT
  484.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  485. #else
  486.     long zero;
  487. #endif
  488.     somStaticClassInfo *sci;
  489.     somDToken        instanceDataToken;
  490.     long reserved [3];
  491.     somMToken somInit;
  492.     somMToken somUninit;
  493.     somMToken GetCurrentRun;
  494.     somMToken NextRun;
  495.     somMToken PreviousRun;
  496.     somMToken GetTotalLength;
  497.     somMToken Initialize;
  498.     somMToken InitWithLocale;
  499. } SOMDLINK FW_OMemoryRunReaderClassData;
  500.  
  501. #if PRAGMA_ALIGN_SUPPORTED
  502. #  pragma options align=reset
  503. #endif
  504.  
  505. #if !defined(FW_OMemoryRunReader_Class_Source) && !defined(SOM_Module_sltxtrun_Source)
  506. #if PRAGMA_IMPORT_SUPPORTED
  507. #pragma import list FW_OMemoryRunReaderClassData
  508. #endif
  509. #endif
  510.  
  511.  
  512. /*
  513.  * -- Typedefs and inline method declarations for left path inherited methods
  514.  * -- are omitted because this compilation had -museinheritedmethods in effect
  515.  */
  516.  
  517.  
  518. /*
  519.  * -- Typedefs for FW_OMemoryRunReader Method Procedures
  520.  */
  521. SOMEXTERN {
  522. typedef FW_OMemoryRunReader*   (* SOMLINK somTD_FW_OMemoryRunReader_Initialize)(FW_OMemoryRunReader *somSelf, Environment *ev,
  523.         corbastring buffer,
  524.         FW_ByteCount length);
  525. typedef FW_OMemoryRunReader*   (* SOMLINK somTD_FW_OMemoryRunReader_InitWithLocale)(FW_OMemoryRunReader *somSelf, Environment *ev,
  526.         corbastring buffer,
  527.         FW_ByteCount length,
  528.         FW_Locale* locale);
  529. }
  530.  
  531. #endif /* FW_OMemoryRunReader_API */
  532.  
  533.  
  534. /*
  535.  * -- This emitter treats Method Tokens as Thunks by default.
  536.  * -- Use the sc modifier "nothunks" to change this default
  537.  */
  538. #undef somresolve_
  539. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  540.  
  541. /*
  542.  * -- The C++ Wrapper Class for FW_OMemoryRunReader
  543.  */
  544. class FW_OMemoryRunReader : public FW_OTextRunReader
  545. {
  546. public:
  547.  
  548. // FW_OMemoryRunReader::new registers use of the class object, and then uses somNew
  549. // to allocate memory and load the object method table pointer. 
  550. void *operator new(size_t size)
  551. {
  552.     SOM_IgnoreWarning(size);
  553.     // Allocate memory using the default allocator for FW_OMemoryRunReader, and
  554.     // clear mem & set method table pointer, call basic initialization
  555. #ifdef SOMCHKNULL
  556.     void * __somResult = (void *)
  557.       somNewObject(FW_OMemoryRunReader);
  558.     SOMCHKNULL(__somResult);
  559.     return __somResult;
  560. #else
  561.     return (void*) somNewObject(FW_OMemoryRunReader);
  562. #endif
  563. }
  564.  
  565. // FW_OMemoryRunReader::delete uses the default deallocator for the object's class.
  566. void operator delete(void * obj)
  567. {
  568.     if (obj) {
  569.         SOM_Resolve(obj,SOMObject,somFree)
  570.            ( (SOMObject*) obj );
  571.     }
  572. }
  573.  
  574. /* method: Initialize */
  575. FW_OMemoryRunReader*   Initialize(Environment *ev,
  576.         corbastring buffer,
  577.         FW_ByteCount length)
  578. {
  579.    #ifdef SOMCHKEXCEPT
  580.    FW_OMemoryRunReader* __somResult = 
  581.       SOM_ResolveD(this,FW_OMemoryRunReader,FW_OMemoryRunReader,Initialize)
  582.     (this,ev,buffer,length);
  583.       SOMCHKEXCEPT;
  584.    return __somResult;
  585. #else
  586.    return SOM_ResolveD(this,FW_OMemoryRunReader,FW_OMemoryRunReader,Initialize)
  587.     (this,ev,buffer,length);
  588. #endif
  589. }
  590.  
  591. /* method: InitWithLocale */
  592. FW_OMemoryRunReader*   InitWithLocale(Environment *ev,
  593.         corbastring buffer,
  594.         FW_ByteCount length,
  595.         FW_Locale* locale)
  596. {
  597.    #ifdef SOMCHKEXCEPT
  598.    FW_OMemoryRunReader* __somResult = 
  599.       SOM_ResolveD(this,FW_OMemoryRunReader,FW_OMemoryRunReader,InitWithLocale)
  600.     (this,ev,buffer,length,locale);
  601.       SOMCHKEXCEPT;
  602.    return __somResult;
  603. #else
  604.    return SOM_ResolveD(this,FW_OMemoryRunReader,FW_OMemoryRunReader,InitWithLocale)
  605.     (this,ev,buffer,length,locale);
  606. #endif
  607. }
  608.  
  609. };   /* FW_OMemoryRunReader */
  610.  
  611.  
  612.  
  613. #endif       /* SOM_FW_OMemoryRunReader_xh */
  614.  
  615. #ifndef SOM_FW_OMemoryRunWriter_xh
  616. #define SOM_FW_OMemoryRunWriter_xh
  617.  
  618. class FW_OMemoryRunWriter;
  619.  
  620. #define FW_OMemoryRunWriter_MajorVersion 1
  621. #define FW_OMemoryRunWriter_MinorVersion 0
  622.  
  623. /*
  624.  * Passthru lines: File: "C.xh", "before"
  625.  */
  626.  
  627.  
  628. /* C++ SOM defs */
  629. #include <somcls.xh>
  630. #include <somcm.xh>
  631.  
  632. /* C++ parent defs */
  633. #ifndef SOM_FW_OTextRunWriter_xh
  634. #include <SLTxtRun.xh>
  635. #endif
  636.  
  637. #ifndef FW_OMemoryRunWriter_API
  638. #define FW_OMemoryRunWriter_API
  639. /*
  640.  * -- The Class API
  641.  */
  642.  
  643. /*
  644.  * Start of user-defined types:
  645.  */
  646.  
  647. /*
  648.  * End of user-defined types.
  649.  */
  650.  
  651. #ifdef OLDIBMSOMAPISUPPORT
  652. #define FW_OMemoryRunWriterCClassData FW_OMemoryRunWriterClassData
  653. #define FW_OMemoryRunWriterNewClass(major,minor) somNewVersionedClassReference(FW_OMemoryRunWriter,major,minor)
  654. #endif
  655.  
  656. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  657. #define FW_OMemoryRunWriterMetaClass SOMClass
  658.  
  659. #if PRAGMA_ALIGN_SUPPORTED
  660. #  pragma options align=power
  661. #endif
  662.  
  663. /* The API to the FW_OMemoryRunWriter class object, and the methods it introduces. */
  664. SOMEXTERN struct FW_OMemoryRunWriterClassDataStructure {
  665. #ifdef OLDIBMSOMAPISUPPORT
  666.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  667. #else
  668.     long zero;
  669. #endif
  670.     somStaticClassInfo *sci;
  671.     somDToken        instanceDataToken;
  672.     long reserved [3];
  673.     somMToken somInit;
  674.     somMToken somUninit;
  675.     somMToken GetCurrentRun;
  676.     somMToken FlushRun;
  677.     somMToken NewRun;
  678.     somMToken Initialize;
  679. } SOMDLINK FW_OMemoryRunWriterClassData;
  680.  
  681. #if PRAGMA_ALIGN_SUPPORTED
  682. #  pragma options align=reset
  683. #endif
  684.  
  685. #if !defined(FW_OMemoryRunWriter_Class_Source) && !defined(SOM_Module_sltxtrun_Source)
  686. #if PRAGMA_IMPORT_SUPPORTED
  687. #pragma import list FW_OMemoryRunWriterClassData
  688. #endif
  689. #endif
  690.  
  691.  
  692. /*
  693.  * -- Typedefs and inline method declarations for left path inherited methods
  694.  * -- are omitted because this compilation had -museinheritedmethods in effect
  695.  */
  696.  
  697.  
  698. /*
  699.  * -- Typedefs for FW_OMemoryRunWriter Method Procedures
  700.  */
  701. SOMEXTERN {
  702. typedef FW_OMemoryRunWriter*   (* SOMLINK somTD_FW_OMemoryRunWriter_Initialize)(FW_OMemoryRunWriter *somSelf, Environment *ev,
  703.         corbastring buffer,
  704.         FW_ByteCount capacity);
  705. }
  706.  
  707. #endif /* FW_OMemoryRunWriter_API */
  708.  
  709.  
  710. /*
  711.  * -- This emitter treats Method Tokens as Thunks by default.
  712.  * -- Use the sc modifier "nothunks" to change this default
  713.  */
  714. #undef somresolve_
  715. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  716.  
  717. /*
  718.  * -- The C++ Wrapper Class for FW_OMemoryRunWriter
  719.  */
  720. class FW_OMemoryRunWriter : public FW_OTextRunWriter
  721. {
  722. public:
  723.  
  724. // FW_OMemoryRunWriter::new registers use of the class object, and then uses somNew
  725. // to allocate memory and load the object method table pointer. 
  726. void *operator new(size_t size)
  727. {
  728.     SOM_IgnoreWarning(size);
  729.     // Allocate memory using the default allocator for FW_OMemoryRunWriter, and
  730.     // clear mem & set method table pointer, call basic initialization
  731. #ifdef SOMCHKNULL
  732.     void * __somResult = (void *)
  733.       somNewObject(FW_OMemoryRunWriter);
  734.     SOMCHKNULL(__somResult);
  735.     return __somResult;
  736. #else
  737.     return (void*) somNewObject(FW_OMemoryRunWriter);
  738. #endif
  739. }
  740.  
  741. // FW_OMemoryRunWriter::delete uses the default deallocator for the object's class.
  742. void operator delete(void * obj)
  743. {
  744.     if (obj) {
  745.         SOM_Resolve(obj,SOMObject,somFree)
  746.            ( (SOMObject*) obj );
  747.     }
  748. }
  749.  
  750. /* method: Initialize */
  751. FW_OMemoryRunWriter*   Initialize(Environment *ev,
  752.         corbastring buffer,
  753.         FW_ByteCount capacity)
  754. {
  755.    #ifdef SOMCHKEXCEPT
  756.    FW_OMemoryRunWriter* __somResult = 
  757.       SOM_ResolveD(this,FW_OMemoryRunWriter,FW_OMemoryRunWriter,Initialize)
  758.     (this,ev,buffer,capacity);
  759.       SOMCHKEXCEPT;
  760.    return __somResult;
  761. #else
  762.    return SOM_ResolveD(this,FW_OMemoryRunWriter,FW_OMemoryRunWriter,Initialize)
  763.     (this,ev,buffer,capacity);
  764. #endif
  765. }
  766.  
  767. };   /* FW_OMemoryRunWriter */
  768.  
  769.  
  770.  
  771. #endif       /* SOM_FW_OMemoryRunWriter_xh */
  772.